<?php if (count($this->errors) > 0) {
    ?>

    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <?php
        foreach ($this->errors as $errorName => $error) {
            foreach ($error as $message) {
                echo "<strong>$errorName : </strong>$message <br />";
            }
        }
        ?>
    </div>
<?php } ?>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title"><?php echo $this->viewName ?></h3>
    </div>
    <div class="panel-body">
        <form action="<?php echo $this->baseUrl() . $this->post ?>" method="post" >
            <?php echo $this->form->id ?>
            <div class="form-group">
                <label for="categoryId">Question Category</label>
                <?php echo $this->form->categoryId ?>
            </div>
            <div class="form-group">
                <label for="title">Question</label>
                <?php echo $this->form->title ?>
            </div>
            <div class="form-group">
                <label for="body">Answer</label>
                <?php echo $this->form->body ?>
            </div>
            
            <div class="form-group">
                <label for="levelId">Level category</label>
                <?php echo $this->form->levelId ?>
            </div>

            <?php echo $this->form->submit ?>
        </form>
    </div>
</div>
<?php $this->headScript()->captureStart() ?>
            // This is a check for the CKEditor class. If not defined, the paths must be checked.
if ( typeof CKEDITOR == 'undefined' )
{
	document.write(
		'<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
		'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
		'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
		'this file, changing the wrong paths in the &lt;head&gt; (line 5) and the "BasePath"' +
		'value (line 32).' ) ;
}
else
{
var editor = CKEDITOR.replace( 'ckeditor_full',
 {
 	filebrowserBrowseUrl : '<?=$this->baseUrl()?>/js/ckfinder/ckfinder.html',
 	filebrowserImageBrowseUrl : '<?=$this->baseUrl()?>/js/ckfinder/ckfinder.html?type=Images',
 	filebrowserFlashBrowseUrl : '<?=$this->baseUrl()?>/js/ckfinder/ckfinder.html?type=Flash',
 	filebrowserUploadUrl : '<?=$this->baseUrl()?>/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
 	filebrowserImageUploadUrl : '<?=$this->baseUrl()?>/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
 	filebrowserFlashUploadUrl : '<?=$this->baseUrl()?>/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
 } 
 );


	// Just call CKFinder.setupCKEditor and pass the CKEditor instance as the first argument.
	// The second parameter (optional), is the path for the CKFinder installation (default = "/ckfinder/").
	CKFinder.setupCKEditor( editor, '<?=$this->baseUrl()?>/js/' ) ;

	// It is also possible to pass an object with selected CKFinder properties as a second argument.
	// CKFinder.setupCKEditor( editor, { basePath : '../', skin : 'v1' } ) ;
}
<?php $this->headScript()->captureEnd() ?>
